package com.pdf.controller;

import com.pdf.service.PrintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @author ytj
 * @date 2021/12/2
 */
@Controller
@RequestMapping("/print")
public class PrintController {
    @Resource
    private PrintService printService;

    @RequestMapping("/index")
    public ModelAndView index(HttpServletResponse response){
        ModelAndView modelAndView=new ModelAndView("/printIndex.html");
        printService.print(response);
        return modelAndView;
    }
}
